#pragma one
#include <stdio.h>
#include <stdlib.h>

#define BUFF_SIZE 1024

//刷新策略
#define NONE_FLUSH (1<<0)
#define LINE_FLUSH (1<<1)
#define FULL_FLUSH (1<<2)

typedef struct IO_FILE
{
    int fileno;  //文件描述符
    int flag;    //文件打开方式
    char outbuff[BUFF_SIZE];  //缓冲区大小
    int bufflen;     //buff有效元素
    int flush_method;  //刷新策略
}MyFILE;


MyFILE* Myopen(const char* path,const char* mode);
int Mywrite(MyFILE* file,void* str,int len);
void Myfclose(MyFILE*);
void Myfflush(MyFILE*);


